﻿using System;
using Loki.UI;
using Loki.UI.Win;
using Luna.UI.Accounting;

namespace Luna.UI.Win.Accounting
{
    /// <summary>
    /// Outcome split by project graph.
    /// </summary>
    public partial class AccountingProjectGraphView : ViewControlBase, IView<AccountingProjectGraphViewModel>
    {
        public AccountingProjectGraphView()
        {
            InitializeComponent();
            this.BindingChanged += AccountingLevelGraphView_BindingChanged;
        }

        public new AccountingProjectGraphViewModel ViewModel
        {
            get { return (AccountingProjectGraphViewModel)base.ViewModel; }
            set { base.ViewModel = value; }
        }

        private void AccountingLevelGraphView_BindingChanged(object P_Sender, EventArgs e)
        {
            CHT_Graph.Series["Account"].ArgumentDataMember = "Argument";
            CHT_Graph.Series["Account"].ValueDataMembers.AddRange("Value");
            CHT_Graph.DataSource = ViewModel.DataSource;
        }
    }
}
